﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0 user-scalable=yes">
    <link href="css/jquery.mobile-1.2.0.min.css" rel="stylesheet" type="text/css" />
    <link href="css/common.css" rel="stylesheet" />
    <!--<link href="css/jquery.mobile.structure-1.2.0.min.css" rel="stylesheet" type="text/css" />
    <link href="css/jquery.mobile.theme-1.2.0.min.css" rel="stylesheet" type="text/css" />-->
    <!--<link href="css/reset.css" rel="stylesheet" type="text/css" />-->
    <script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="js/jquery.mobile-1.2.0.min.js" type="text/javascript"></script>
    <script src="js/Oup.Http.URL.js"></script>
    <script src="js/phonegap.js"></script>
    <script src="js/ChildBrowser.js"></script>
</head>
<body>

    <div data-role="dialog">
        <div data-role="header" data-theme="d">
            <h1>分享</h1>
        </div>

        <div data-role="content" data-theme="c">
            <input type="hidden" id="proTitle" />
            <h1 style="margin-top: 0px;">分享</h1>
            <p>快快和朋友一起分享吧！</p>
            <a target="_blank" vt="qq" name="share" href="#" data-role="button" data-theme="b">分享到qq空间</a>
            <a target="_blank" vt="qqweibo" name="share" href="#" data-role="button" data-theme="b">分享到qq微博</a>
            <a target="_blank" vt="sina" name="share" href="#" data-role="button" data-theme="b">分享到新浪微博</a>
            <a target="_blank" vt="kaixin" name="share" href="#" data-role="button" data-theme="b">分享到开心网</a>
            <a target="_blank" vt="renren" name="share" href="#" data-role="button" data-theme="b">分享到人人网</a>
            <a target="_blank" vt="baidu" name="share" href="#" data-role="button" data-theme="b">分享到百度</a>
            <a id="btnBack" href="#" data-role="button" data-theme="c">Cancel</a>
        </div>
        <script type="text/javascript">
            var shareHost = {
                "qq": "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=${url}&title=${title}&desc=&summary=&site=",
                "sina": "http://service.weibo.com/share/share.php?url=${url}&title=${title}",
                "qqweibo": "http://share.v.t.qq.com/index.php?c=share&a=index&url=${url}&title=${title}",
                "kaixin": "http://www.kaixin001.com/rest/records.php?url=${url}&style=11&content=${title}&stime=&sig=",
                "renren": "http://widget.renren.com/dialog/share?resourceUrl=${url}&title=${title}&description=",
                "baidu": "http://tieba.baidu.com/f/commit/share/openShareApi?url=${url}&title=${title}&desc=&comment=",
            };
            
            $(function () {
            });

            var title;
            var id;
            
            $(document).live('pagecreate', function (event) {
            	var urlContent = window.HtmlContent.getContent();
            	title= Oup.Http.URL.getString(urlContent,'title');
            	id= Oup.Http.URL.getString(urlContent,'id');
            	
                if ($("a[title='Close']").length == 1) {
                    $("a[title='Close']").hide();
                }
                
                $("#btnBack").click(function() {
                    location.href="?goback=1";
                });
            	$("a[name='share']").click(function () {
                    var vt = $(this).attr("vt");
                    var url = shareHost[vt].replace("${title}", title).replace("${url}", "http://m.miaomiaojia.com/detail.html?id=" + id);
                    url = encodeURI(url);
                    location.href=url;
                });
            	
            	
            });
        </script>
    </div>
</body>
</html>
